Hitachi HD44780 LCD controller

Hitachi HD44780 LCD controller is one of the most common dot matrix liquid crystal display (LCD) display controllers available. Hitachi developed the microcontroller specifically to drive alphanumeric LCD display with a simple interface that could be connected to a general purpose microcontroller or microprocessor. Many manufacturers of displays integrated the controller with their product making it the informal standard for this type this type of displays.[1] The device can display ASCII characters, Japanese Kana characters, and some symbols in two 28 character lines. Using an extension driver, the device can display up to 80 characters.[2]

Contents

Architecture

These LCD screens are limited to monochrome text and are often used in copiers, fax machines, laser printers, industrial test equipment, networking equipment such as routers and storage devices.

The screens come in a small number of standard configurations. Common sizes are 8x1 (one row of eight characters), 16x2, 20×2 and 20x4. Larger custom sizes are made with 32, 40 and 80 characters and with 1, 2, 4 or 8 lines. The most commonly manufactured larger configuration is 40x4 characters, which requires two individually addressable HD44780 controllers with expansion chips as a single HD44780 chip can only address up to 80 characters. A common smaller size is 16×2, and this size is readily available as surplus stock for hobbyist and prototyping work.

Character LCDs can come with or without backlights, which may be LED, fluorescent, or electroluminescent.

Character LCDs use a standard 16 contact interface, commonly using pins or card edge connections on 0.1 inch / 2.54mm centers. Those without backlights may have only 14 pins, omitting the final two pins powering the light. The pinout is as follows:

  1. Ground
  2. VCC (+3.3 to +5V)
  3. Contrast adjustment (VO)
  4. Register Select (RS). RS=0: Command, RS=1: Data
  5. Read/Write (R/W). R/W=0: Write, R/W=1: Read
  6. Clock (Enable). Falling edge triggered
  7. Bit 0 (Not used in 4-bit operation)
  8. Bit 1 (Not used in 4-bit operation)
  9. Bit 2 (Not used in 4-bit operation)
  10. Bit 3 (Not used in 4-bit operation)
  11. Bit 4
  12. Bit 5
  13. Bit 6
  14. Bit 7
  15. Backlight Anode (+)
  16. Backlight Cathode (-)

The nominal operating voltage for LED backlights is 5V at full brightness, with dimming at lower voltages dependent on the details such as LED color. Non-LED backlights often require higher voltages.

The HD44780 interface allows for two modes of operation, 8-bit and 4-bit. Using the 4 bit mode is more complex, but reduces the number of active connections needed. The chip starts in 8 bit mode, with the instruction set designed to allow switching without requiring the lower four data pins. Once in 4 bit mode, character and control data is transferred as pairs of 4 bit "nibbles" on the upper data pins, D4-D7.

Instruction Set

The HD44780 instruction set is shown below[3]:

HD44780U based instruction set
Instruction Code Description Execution
time (max)
(when fcp = 270 kH)
RS R/W B7 B6 B5 B4 B3 B2 B1 B0
Clear display 0 0 0 0 0 0 0 0 0 1 Clears display and returns cursor to the home position (address 0). 1.52 ms
Cursor home 0 0 0 0 0 0 0 0 1 * Returns cursor to home position. Also returns display being shifted to the original position. DDRAM content remains unchanged. 1.52 ms
Entry mode set 0 0 0 0 0 0 0 1 I/D S Sets cursor move direction (I/D); specifies to shift the display (S). These operations are performed during data read/write. 37 μs
Display on/off control 0 0 0 0 0 0 1 D C B Sets on/off of all display (D), cursor on/off (C), and blink of cursor position character (B). 37 μs
Cursor/display shift 0 0 0 0 0 1 S/C R/L * * Sets cursor-move or display-shift (S/C), shift direction (R/L). DDRAM content remains unchanged. 37 μs
Function set 0 0 0 0 1 DL N F * * Sets interface data length (DL), number of display line (N), and character font (F). 37 μs
Set CGRAM address 0 0 0 1 CGRAM address Sets the CGRAM address. CGRAM data are sent and received after this setting. 37 μs
Set DDRAM address 0 0 1 DDRAM address Sets the DDRAM address. DDRAM data are sent and received after this setting. 37 μs
Read busy flag &
address counter
0 1 BF CGRAM/DDRAM address Reads busy flag (BF) indicating internal operation being performed and reads CGRAM or DDRAM address counter contents (depending on previous instruction). 0 μs
Write CGRAM or
DDRAM
1 0 Write Data Write data to CGRAM or DDRAM. 37 μs
Read from CG/DDRAM 1 1 Read Data Read data from CGRAM or DDRAM. 37 μs
Instruction bit names —

I/D - 0 = decrement cursor position, 1 = increment cursor position; S - 0 = no display shift, 1 = display shift; D - 0 = display off, 1 = display on; C - 0 = cursor off, 1 = cursor on; B - 0 = cursor blink off, 1 = cursor blink on ; S/C - 0 = move cursor, 1 = shift display; R/L - 0 = shift left, 1 = shift right; DL - 0 = 4-bit interface, 1 = 8-bit interface; N - 0 = 1/8 or 1/11 duty (1 line), 1 = 1/16 duty (2 lines); F - 0 = 5 × 8 dots, 1 = 5 × 10 dots; BF - can accept instruction, 1 = internal operation in progress.

Font

The original HD44780 character generator ROM contains 208 characters in a 5x8 dot matrix, and 32 characters in a 5x10 dot matrix. More recent compatible chips are available with higher resolution, matched to displays with more pixels.

There is a Japanese version of the ROM which includes kana characters, and a European version which includes Cyrillic and Western European characters.

The 7-bit ASCII subset for the Japanese version is non-standard: it supplies a Yen symbol where the backslash character is normally found, and left and right arrow symbols in place of tilde and the rub-out character.

A limited number of custom characters can be programmed into the device in the form of a bitmap using special commands. These characters have to be written to the device each time it is switched on, as they are stored in volatile memory.

See also

Footnotes

  1. ^ Wilmshurst 2010, p. 228
  2. ^ Sanchez & Canton 2007, p. 275
  3. ^ Huang 2009, p. 326

References

  • Huang, Han-Way (2009). The HCS12 / 9S12: An Introduction to Software and Hardware Interfacing (2nd ed.). Delmar Cengage Learning. ISBN 978-1435427426. 
  • Sanchez, Julio; Canton, Maria P. (2007). Microcontroller Programming: the Microchip PIC. CRC Press. ISBN 978-0-8493-7189-9. 
  • Wilmshurst, Tim (2010). Designing Embedded Systems with PIC Microcontrollers: Principles and Applications. Elsevier. ISBN 978-1-85617-750-4. 

External links